(function () {
    angular.module('app')
        .factory('ShoppingCartFactory',fn);

    //var localPersonInfo = {};
    function fn(urlCnst,mockHttp,userService) {
        var self = {};

        self.getDrugInCart = function (userId, cb) {
            if( !urlCnst['mockHttp'] ){
                urlCnst.get('carts/user/'+ userId +'/?page=1&size=3',cb);
            }
            else {
                var commodity = userService.drugInCart;
                for ( var i=0; i<commodity.length; i++ ){
                    if ( drug['res'][i]['drugId'] == drugId ) result['res'].push(drug['res'][i]);
                }
                return cb(0,userService.drugInCart);
            }
        };
        return self;
    }
})();
